package parttern.strategy;

public class TravelDispatcher {

    private ITravelStrategy mTravelStrategy;

    public void setTravelStrategy(ITravelStrategy travelStrategy) {
        this.mTravelStrategy = travelStrategy;
    }

    public void travel() {
        mTravelStrategy.travel();
    }


    ///test
    public static void main(String[] args) {
        ITravelStrategy airplaneTravel = new AirplaneTravel();
        TravelDispatcher travelDispatcher = new TravelDispatcher();
        travelDispatcher.setTravelStrategy(airplaneTravel);
        travelDispatcher.travel();
    }
}
